package com.tiny.mirror.service.product.infrastructure.entity.db;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tiny.mirror.basic.db.mybatis.entity.AuditedEntity;
import com.tiny.mirror.basic.db.mybatis.handler.JacksonTypeHandler;
import com.tiny.mirror.service.product.domain.platform.PlatformParams;
import com.tiny.mirror.service.product.enums.PlatformStatusEnum;
import com.tiny.mirror.service.product.enums.PlatformTypeEnum;
import lombok.Getter;
import lombok.Setter;
import org.apache.ibatis.type.JdbcType;

@Getter
@Setter
@TableName(value = "platform", autoResultMap = true)
public class PlatformEntity extends AuditedEntity<Long> {

  @TableId(value = "id", type = IdType.AUTO)
  private Long id;
  @TableField(value = "app_id")
  private Long appId;
  @TableField(value = "name")
  private String name;
  @TableField(value = "params", jdbcType = JdbcType.VARCHAR, typeHandler = JacksonTypeHandler.class)
  private PlatformParams params;
  @TableField(value = "type")
  private PlatformTypeEnum type;
  @TableField(value = "status")
  private PlatformStatusEnum status;
  @TableField(value = "order_num")
  private Integer orderNum;
}
